object Modulo {
    def main ( ) : Unit = {
        println ( new Mod ( ) . computeModulo ( 134 , 5 ) );
    }
}
 
class Mod {
    def computeModulo ( big : Int , mod : Int ) : Int = {
        
	    var rest : Int ;
		rest = big ;

		while ( mod < rest ){
			rest = rest - mod ;
		}
		
        return rest ;
    }
}